package com.atguigu.gmall.activity.redis;

import com.atguigu.gmall.activity.util.CacheHelper;
import javafx.scene.CacheHint;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import java.util.Calendar;

@Component
public class MessageReceive {

    public void receiveMessage(String message){
        System.out.println("----------收到消息了message：\"+message");
        if(!StringUtils.isEmpty(message)){
            message = message.replaceAll("\"","");
            String[] split = StringUtils.split(message, ":");
            if(split==null || split.length==2){
                CacheHelper.put(split[0], split[1]);
            }
        }
    }
}
